import { createRouter } from 'vue-router';
import { createApp, ref } from 'vue';
import { router } from '@iboot-vue/common';
import { SvgIcon } from '@iboot-vue/common';
import 'virtual:svg-icons-register';
import App from './App.vue';
import { createPinia } from 'pinia';
import { AppStore } from '@/app.store';
import packageJson from '../package.json';
import './style/index.less';
import AntdComponent from '@iboot-vue/antd-component2';
import '@iboot-vue/antd-component2/es/index.css';
import '@/app/mock/index';
const app = createApp(App);

app.use(router({
  basePath: import.meta.env.VITE_APP_BASE,
  components: import.meta.glob(['/src/app/**/router/*.ts'], {
    eager: true
  })
}, createRouter)
);
app.use(createPinia());
app.use(AntdComponent.component);
app.use(AntdComponent.layout);
app.mount('#app');
app.component('SvgIcon', SvgIcon);
document.title = import.meta.env.VITE_APP_TITLE;
AppStore().setApp({
  name: packageJson.name,
  version: packageJson.version,
  dependencies: Object.assign(packageJson.dependencies || {}, packageJson.devDependencies || {})
});
